//
//  LYOrderCell.m
//  artist
//
//  Created by Jay_Apple on 16/4/14.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYOrderCell.h"
#import "LYOrderDetailModel.h"

@interface LYOrderCell ()

@property (weak, nonatomic) IBOutlet UIImageView *icon;

@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *titile;
@property (weak, nonatomic) IBOutlet UILabel *status;
@property (weak, nonatomic) IBOutlet UILabel *price;

@end

@implementation LYOrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)setModel:(LYOrderListModel *)model{

    _model = model;
    
    [self.icon sd_setImageWithURL:[NSURL URLWithString:_model.course_image] placeholderImage:[UIImage imageNamed:@"contacts_default_avatar"]];
    
    self.titile.text = _model.title;
    self.name.text = _model.nick_name;
    self.price.text = [NSString stringWithFormat:@"¥%@",_model.order_money];
    
    switch (_model.status) {
        case orderStatusPay:
            self.status.text = @"已支付";
            break;
            
        case orderStatusNoPay:
            self.status.text = @"未支付";
            break;
            
        case orderStatusUsed:
            self.status.text = @"已验证";
            break;
            
        case orderStatusCancel:
            self.status.text = @"已取消";
            break;
            
        case orderStatusHanding:
            self.status.text = @"退款中";
            break;
            
        case orderStatusRefund:
            self.status.text = @"已退款";
            break;
            
        case orderStatusApplyRefund:
            self.status.text = @"申请退款";
            break;
    }

}
@end
